package priv.pattern.facadepatterns;

import priv.pattern.facadepatterns.service.Function;
import priv.pattern.facadepatterns.service.impl.CpuImpl;
import priv.pattern.facadepatterns.service.impl.DiskImpl;
import priv.pattern.facadepatterns.service.impl.MemoryImpl;
import sun.plugin2.gluegen.runtime.CPU;

/*
 * 作者：m鹏h
 * 时间；2024/7/30 23:04
 * 描述：电脑 外观类
 **/
public class Computer implements Function {

    private CpuImpl cpu;
    private DiskImpl disk;
    private MemoryImpl memory;

    /*
    * 统一开启电脑方法
    *
    * */
    @Override
    public void start() {
        this.cpu.start();
        this.disk.start();
        this.memory.start();
    }
    /*
     * 统一关闭电脑方法
     *
     * */
    @Override
    public void close() {
        this.cpu.close();
        this.disk.close();
        this.memory.close();
    }

    public Computer() {
        this.cpu = new CpuImpl();
        this.disk = new DiskImpl();
        this.memory = new MemoryImpl();
    }


}

